#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
//倒置字符串
//I like beijing.倒置为 beijing. like I
void reserve(char* left, char* right)
{
	while (left < right)
	{
		char temp = *left;
		*left = *right;
		*right = temp;
		left++;
		right--;
	}
}
int main()
{
	char arr[101];
	gets(arr);
	//scanf("%[^\n]s",arr);
	int len = strlen(arr);
	reserve(arr, arr+len - 1);//先将整个字符串倒置，结果为.gnijieb ekil I
	//接下来再把每个单词倒置
	char* start = arr;
	char* end = arr;
	while (*end)
	{
		while (*end != ' ' && *end != '\0')
		{
			end++;
		}
		reserve(start, end - 1);
		start = end + 1;
		if (*end == ' ')
			end++;
	}
	printf("%s\n", arr);
	return 0;
}